package com.example.sell.dataobject;

import com.example.sell.enums.DeleteFlagEnum;
import com.example.sell.enums.OrderStatusEnum;
import com.example.sell.enums.PayStatueEnum;
import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author: vince_zww
 * @date: 2020/8/13 16:30
 * @desceription: 订单表
 */
@Entity
@Data
@DynamicUpdate
public class OrderMaster {

    /**
     * 订单id
     */
    @Id
    private String orderId;

    /**
     * 买家名字
     */
    private String buyerName;

    /**
     * 买家手机号
     */
    private String buyerPhone;

    /**
     * 买家地址
     */
    private String buyerAddress;

    /**
     * 买家微信Openid
     */
    private String buyerOpenid;

    /**
     * 订单金额
     */
    private BigDecimal orderAmount;

    /**
     * 订单状态，默认为新下订单
     */
    private Integer orderStatus = OrderStatusEnum.NEW.getCode();

    /**
     * 支付状态，默认未支付
     */
    private Integer payStatus = PayStatueEnum.WAIT.getCode();

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    /**
     * 0：未删除，1：已删除
     */
    private Integer deleteFlag = DeleteFlagEnum.FALSE.getCode();


}
